{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/design-hashmap\n",
    "\n",
    "\n",
    "Runtime: 172 ms, faster than 98.07% of Python3 online submissions for Design HashMap.\n",
    "Memory Usage: 17.2 MB, less than 91.33% of Python3 online submissions for Design HashMap.\n",
    "\n",
    "\n",
    "\n",
    "```python\n",
    "class MyHashMap:\n",
    "\n",
    "    def __init__(self):\n",
    "        \"\"\"\n",
    "        Initialize your data structure here.\n",
    "        \"\"\"\n",
    "        self.d = dict()\n",
    "        \n",
    "\n",
    "    def put(self, key: int, value: int) -> None:\n",
    "        \"\"\"\n",
    "        value will always be non-negative.\n",
    "        \"\"\"\n",
    "        self.d[key] = value\n",
    "        \n",
    "\n",
    "    def get(self, key: int) -> int:\n",
    "        \"\"\"\n",
    "        Returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key\n",
    "        \"\"\"\n",
    "        if key in self.d:\n",
    "            return self.d[key]\n",
    "        else:\n",
    "            return -1\n",
    "        \n",
    "\n",
    "    def remove(self, key: int) -> None:\n",
    "        \"\"\"\n",
    "        Removes the mapping of the specified value key if this map contains a mapping for the key\n",
    "        \"\"\"\n",
    "        if key in self.d:\n",
    "            del self.d[key]\n",
    "```\n",
    "\n",
    "\n",
    "Spent 2 minutes."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
